package com.zjc.agent.ai.service;

import com.zjc.agent.ai.guardrail.SafeInputGuardrail;
import dev.langchain4j.service.MemoryId;
import dev.langchain4j.service.SystemMessage;
import dev.langchain4j.service.UserMessage;
import dev.langchain4j.service.guardrail.InputGuardrails;
import reactor.core.publisher.Flux;

import java.util.List;
@InputGuardrails({SafeInputGuardrail.class})
public interface AIFlightHelperService {
    // 系统提示词
    @SystemMessage(fromResource = "system-prompt.txt")
    String chat(@MemoryId int memoryId, @UserMessage String userMessage);

    String plainChat(@MemoryId int memoryId, @UserMessage String userMessage);

    // 定义返回类型
    @SystemMessage(fromResource = "system-prompt.txt")
    FlightData chatForFlight(String userMessage);
    // 航班数据
    record FlightData(String name, List<String> fights) {
    }

    // 流式输出
    @SystemMessage(fromResource = "system-prompt.txt")
    Flux<String> chatStream(@MemoryId int memoryId,@UserMessage String userMessage);
}